﻿Imports System.Windows.Forms

Public Class SelectProfile2

    Friend i As Integer = 0
    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.Close()
        i = 0
        For Each item In ListView1.Items
            If ListView1.Items(i).Selected Then
                pathname = ListView1.Items(i).SubItems(1).Text
                If pathname.StartsWith("/hdd1") Then
                    pathname = ListView1.Items(i).SubItems(1).Text.Remove(31, 34)
                ElseIf pathname.StartsWith("/OnBoardMU") Then
                    pathname = ListView1.Items(i).SubItems(1).Text.Remove(36, 34)
                ElseIf pathname.StartsWith("/memunit0") Then
                    pathname = ListView1.Items(i).SubItems(1).Text.Remove(31, 34)
                ElseIf pathname.StartsWith("/memunit1") Then
                    pathname = ListView1.Items(i).SubItems(1).Text.Remove(31, 34)
                End If
                TransferProfiles()
            End If
                i += 1
        Next
        Main.ToolStripStatusLabel1.Text = Main.GamesCount & " Saves Found"
        ftp.Disconnect()
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

End Class
